<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .point {
      width: 10px;
      height: 10px;
      background-color: red;
      position: relative;
      top: 0;
      left: 0;
      margin-top: 20px;
    }
  </style>
</head>

<body>
  <div class="point" id="animation1"></div>
  <div class="point" id="animation2"></div>
</body>
<script>
  const animation1 = document.getElementById('animation1');
  const animation2 = document.getElementById('animation2');
  let left1 = 0;
  let left2 = 0;
  setTimeoutAnimation()
  setRequestAnimationFrame()
  function setTimeoutAnimation() {
    if (left1 > 600) return
    setTimeout(() => {
      left1++
      animation1.style.left = `${left1}px`
      setTimeoutAnimation()
    }, 1000 / 60)
  }
  function setRequestAnimationFrame() {
    if (left2 > 600) return
    requestAnimationFrame(() => {
      left2++
      animation2.style.left = `${left2}px`
      setRequestAnimationFrame()
    })
  }
</script>

</html>